#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

#include <heartbeat_thread.h>
#include "rov_config.h"
#include "recv_video_thread.h"
#include "utils.h"

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();
    MYHeartbeatThread* m_heartbeat_thread;
    udp::UDPSender udp_sender;
    long long video_last_timestamp;
    void set_fps(double delay, double fps);

    void lock_all();

private slots:
    void do_update_system_log(QString log);
    void do_update_video_frame(QImage image);
    void do_update_sbus_frame(std::vector<uint16_t> ch);
    void do_update_heartbeat_state(int state);

    void on_pushButton_connect_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_5_clicked();

    void on_pushButton_clear_log_clicked();

    void on_pushButton_pic_clicked();


    void on_checkBox_yg_lock_stateChanged(int arg1);

private:
    Ui::MainWindow *ui;
    CONFIG heart_config;
};
#endif // MAINWINDOW_H
